<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" href="/lib/jquery-easyui/themes/icon.css"/>
    <link rel="stylesheet" href="/lib/jquery-easyui/themes/default/easyui.css"/>
</head>
<script type="text/javascript">


    function openAddBtnWin() {
        $("#addBtnWin").show().window("open");
    }
    //关闭添加按钮窗口
    function cancelAddWin() {
        $("#technologyName").val('');
        $("#addBtnWin").window("close");
    }



    //确认添加按钮
    function addTechnologyBtn() {
        $.messager.confirm('提示','工艺按钮添加后将无法删除,您确定添加吗？',function(r){
            if(r){
                $.ajax({
                    type: "POST",
                    url: "addTechnology",
                    data: $("#addBtnForm").serialize(),
                    timeout: 20000,
                    dataType: "json",
                    cache: false,
                    success: function (data) {
                        if (data.msg == "success") {
                            $.messager.alert("提示", "添加成功！","info",function () {
                                window.location.reload();
                            });
                        } else {
                            $.messager.alert("警告", "添加失败！","info",function () {
                                window.location.reload();
                            })
                        }
                    },
                    error: function () {
                        $.messager.alert("提示", "出现了不可预知的错误，请重新操作！");
                    }
                })
            }

        });

    }

</script>
<style>
    #userList {
        margin: 0 auto;
    }

    #addUserForm {
        float: left;
        position: absolute;
        left: 60px;
    }

    #Btn {
        float: left;
        position: absolute;
        left: 80px;
        top: 250px;;
    }
</style>
<body>
<div id="dglist"></div>


<div id="editTechnologyWin" align="center" class="easyui-window" title="修改工艺" style="width:450px;height: 370px;display: none"
     data-options="iconCls:'icon-save',modal:true,closed:true">
    <br/>
    <br/>
    <form id="editTechnologyForm"  name="editTechnologyForm" method="post">
        <input class="easyui-textbox" style="width:150px" id="projectId" name="projectId" type="text"
               data-options="required:true,validateOnBlur:true,validateOnCreate:false"
        />
        <input class="easyui-textbox" style="width:150px" id="tpId" name="tpId" type="text"
               data-options="required:true,validateOnBlur:true,validateOnCreate:false"
        />        <table>
            <tr>
                <td><span style="color: red">*</span>工艺名称：</td>
                <td><input class="easyui-textbox" style="width:150px" id="tpProductionProcesses" name="tpProductionProcesses" type="text"
                            data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>序号：</td>
                <td><input class="easyui-textbox" style="width:150px" id="tpSequenceNumber" name="tpSequenceNumber" type="text"
                           prompt="请输序号" data-options="required:true,validateOnBlur:true,validType:'integer',validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>工艺内容：</td>
                <td><input class="easyui-textbox" style="width:150px" id="tpProcessContent" name="tpProcessContent" type="text"
                           prompt="请输工艺内容" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>生产数量：</td>
                <td><input class="easyui-textbox" style="width:150px" id="tpProductionQuantity" name="tpProductionQuantity" type="text"
                           prompt="请输生产数量" data-options="required:true,validType:'integer',validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>预估工时(H)：</td>
                <td><input class="easyui-textbox" style="width:150px" id="tpEstimateTime" name="tpEstimateTime" type="text"
                           prompt="请输预估工时" data-options="required:true,validType:'isNumber',validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>操作员：</td>
                <td><input class="easyui-textbox" style="width:150px" id="tpOperator" name="tpOperator" type="text"
                           prompt="请输操作员" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
        </table>

        <div style="margin-top: 20px;">
            <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="#"  onclick="editTechnology()" style="width:70px">保 存</a>
            <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="#" onclick="cancelWin('editTechnologyWin','editTechnologyForm')" style="width:70px">取 消</a>
        </div>
    </form>
</div>

<!-- 点击修改基本信息按钮弹出的窗口 -->
<div id="updateProjectWin" style="display: none">
    <br/>
    <br/>
    <form id="updateProjectForm"  name="addProjectForm" style="margin-left: 80px;" method="post">
        <input class="easyui-textbox" style="width:150px" id="id" name="id" type="text"
                   data-options="required:true,validateOnBlur:true,validateOnCreate:false"
        />       <table>
            <tr>
                <td><span style="color: red">*</span>项目名称：</td>
                <td><input class="easyui-textbox" style="width:150px" id="projectName" name="projectName" type="text"
                           prompt="请输入项目名称" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td height="5px"></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>零件名称：</td>
                <td><input class="easyui-textbox" style="width:150px" id="partsName" name="partsName" type="text"
                           prompt="请输入零件名称" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td height="5px"></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>图 号：</td>
                <td><input class="easyui-textbox" style="width:150px" id="chartNumber" name="chartNumber" type="text"
                           prompt="请输入图号" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
            <tr>
                <td height="5px"></td>
            </tr>
            <tr>
                <td><span style="color: red">*</span>订单数量：</td>
                <td><input class="easyui-textbox" style="width:150px" id="oderNumber" name="oderNumber" type="text"
                           prompt="请输入订单数量" data-options="required:true,validateOnBlur:true,validType:'integer',validateOnCreate:false"
                /></td>
            </tr>
        </table>
    </form>
</div>

<!--增加工艺流程界面-->
<div id="addTechnologyWin"  align="center" class="easyui-window" resizable=false maximizable=false minimizable=false  title="工艺添加按钮" style="overflow:hidden;width:903px;height: 500px;display: none" data-options="iconCls:'icon-save',modal:true,closable: false,closed:true">

    <!-- 按钮窗口 -->
    <div id="btnpanel"  class="easyui-panel"
         style="overflow-x :auto;width:900px;height:auto;padding:10px;background:#fafafa;"
         data-options="iconCls:'icon-save',
		    collapsible:true">
        &nbsp;&nbsp;
    </div>
    <!-- form表单 -->
    <div class="easyui-panel"  style="width:900px;height:auto;">
        <div style="padding:10px 0 0 0">
            <form id="addTechnologyForm" method="post">
                <input id="showProjectId" name="showProjectId" type="hidden">
                <input  disabled=true class="easyui-textbox" style="width:125px;text-align: center;" type="text" value='项目名称:' data-options="required:true"></input>
                <input   id="showProjectName" name="showProjectName" class="easyui-textbox" style="width:325px;" type="text"  data-options="required:true"></input>
                <input   disabled=true class="easyui-textbox" style="width:175px;text-align: center;" type="text" value='零件名称:' data-options="required:true"></input>
                <input    id="showPartsName" name="showPartsName" class="easyui-textbox" style="width:247px;" type="text"  data-options="required:true"></input>

                <input  disabled=true class="easyui-textbox" style="width:125px;text-align: center;" value='图号:' type="text"  data-options="required:true"></input>
                <input  id="showChartNumber" name="showChartNumber" class="easyui-textbox" style="width:325px;" type="text"  data-options="required:true"></input>
                <input  disabled=true class="easyui-textbox" style="width:175px;text-align: center;"  value='订单数量:' type="text"  data-options="required:true"></input>
                <input   id="showOderNumber" name="showOderNumber" class="easyui-textbox" style="width:247px;" type="text"  data-options="required:true,validType:'integer'"></input>

            </form>
        </div>
    </div>
    <!-- 列表 -->
    <div id="technologydglist"></div>
    <div id="copyBtn" style="margin-top:5px;">
        <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="#"  onclick="exportTechnologicalProcess()" style="width:70px">导 出</a>
        <a class="easyui-linkbutton" data-options="iconCls:'icon-no'" href="#"  onclick="canceladdTechnologyWin()" style="width:70px">关 闭</a>
    </div>
    <!-- 添加按钮的窗口 -->
    <div id="addBtnWin" align="center" class="easyui-window" title="添加工艺按钮" style="width:450px;height: 200px;display: none"
         data-options="iconCls:'icon-save',modal:true,closed:true">
        <br/>
        <br/>
        <form id="addBtnForm"  name="addBtnForm" method="post">
            <input type="hidden" id="btnId" name="btnId"/>
        <table>
            <tr>
                <td><span style="color: red">*</span>工艺名称：</td>
                <td><input class="easyui-textbox" style="width:150px" id="technologyName" name="technologyName" type="text"
                           prompt="请输入工艺名称" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                /></td>
            </tr>
        </table>

        <div id="saveBtn" style="margin-top: 40px;">
            <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="#"  onclick="addTechnologyBtn()" style="width:70px">添 加</a>
            <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="#" onclick="cancelAddWin('addTechnologyWin','addTechnologyWin')" style="width:70px">取 消</a>
        </div>
        </form>
    </div>

  <!-- 点击工艺按钮弹出此窗口-->
    <div id="clickBtnWin" align="center" class="easyui-window" title="添加工艺" style="width:450px;height: 370px;display: none"
         data-options="iconCls:'icon-save',modal:true,closed:true">
        <br/>
        <br/>
        <form id="clickBtnForm"  name="clickBtnForm" method="post">
            <table>
                <tr>
                    <td><span style="color: red">*</span>工艺名称：</td>
                    <td><input class="easyui-textbox" style="width:150px" id="productionProcesses" name="productionProcesses" type="text"
                               disabled=true data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                    /></td>
                </tr>
                <tr>
                    <td><span style="color: red">*</span>序号：</td>
                    <td><input class="easyui-textbox" style="width:150px" id="sequenceNumber" name="sequenceNumber" type="text"
                               prompt="请输序号" data-options="required:true,validateOnBlur:true,validType:'integer',validateOnCreate:false"
                    /></td>
                </tr>
                <tr>
                    <td><span style="color: red">*</span>工艺内容：</td>
                    <td><input class="easyui-textbox" style="width:150px" id="processContent" name="processContent" type="text"
                               prompt="请输工艺内容" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                    /></td>
                </tr>
                <tr>
                    <td><span style="color: red">*</span>生产数量：</td>
                    <td><input class="easyui-textbox" style="width:150px" id="productionQuantity" name="productionQuantity" type="text"
                               prompt="请输生产数量" data-options="required:true,validType:'integer',validateOnBlur:true,validateOnCreate:false"
                    /></td>
                </tr>
                <tr>
                    <td><span style="color: red">*</span>预估工时(H)：</td>
                    <td><input class="easyui-textbox" style="width:150px" id="estimateTime" name="estimateTime" type="text"
                               prompt="请输预估工时" data-options="required:true,validType:'isNumber',validateOnBlur:true,validateOnCreate:false"
                    /></td>
                </tr>
                <tr>
                    <td><span style="color: red">*</span>操作员：</td>
                    <td><input class="easyui-textbox" style="width:150px" id="operator" name="operator" type="text"
                               prompt="请输操作员" data-options="required:true,validateOnBlur:true,validateOnCreate:false"
                    /></td>
                </tr>
            </table>

            <div id="saveTechnology" style="margin-top: 20px;">
                <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="#"  onclick="addTechnology()" style="width:70px">添 加</a>
                <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="#" onclick="cancelWin('clickBtnWin','clickBtnForm')" style="width:70px">取 消</a>
            </div>
        </form>
    </div>

</div>


<div id="detailWin" class="easyui-window" title="工艺流程步骤"
     closed="true" style="width:900px;height:400px;padding:5px;display: none">
    <div id="detailList"></div>
    <div style="margin-top:5px;" align="center">
        <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="#"  onclick="exportFTechnologicalProcess()" style="width:70px">导 出</a>
    </div>
</div>
<script src="/lib/jquery/dist/jquery.js"></script>
<script src="/lib/jquery-easyui/jquery.easyui.min.js"></script>
<script src="/lib/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="/lib/jquery-easyui/easyui-extend/easyui-extend-rcm.js"></script>
<script src="/common/common.js"></script>
<script src="addTechnologyWin.js"></script>
<script src="productionproject_index.js"></script>
</body>
</html>